function calHeight(doc) {
    if (doc) {
        var cHeight = Math.max(doc.body.clientHeight, doc.documentElement.clientHeight);
        var sHeight = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight);
        var finalHeight = Math.max(sHeight, cHeight);
        return finalHeight;
    }
    return 0;

}

function calWidth(doc) {
    if (doc) {
        var cWidth = Math.max(doc.body.clientWidth, doc.documentElement.clientWidth);
        var sWidth = Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth);
        var width = Math.max(cWidth, sWidth);
        return width;
    }
    return 0;
}

function changeNavSelected(a) {
    var as = document.getElementsByClassName('nav');
    for (var b = 0; b < as.length; b++) {
        as[b].setAttribute("class", "nav");
    }
    a.setAttribute("class", "nav selected");
}